home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 July: Mac OS SDK / Dev.CD Jul 99 SDK1.toast / Development Kits / Mac OS / Interfaces&Libraries / Universal / Interfaces / AIncludes / Palettes.a < prev    next >
Encoding:
Text File  |  1998-08-17  |  10.9 KB  |  407 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        Palettes.a
  3. ;
  4. ;    Contains:    Palette Manager Interfaces.
  5. ;
  6. ;    Version:    Technology:    Mac OS 8
  7. ;                Release:    Universal Interfaces 3.2
  8. ;
  9. ;    Copyright:    © 1987-1993, 1995-1998 by Apple Computer, Inc., all rights reserved
  10. ;
  11. ;    Bugs?:        For bug reports, consult the following page on
  12. ;                the World Wide Web:
  13. ;
  14. ;                    http://developer.apple.com/bugreporter/
  15. ;
  16. ;
  17.     IF &TYPE('__PALETTES__') = 'UNDEFINED' THEN
  18. __PALETTES__ SET 1
  19.  
  20.     IF &TYPE('__QUICKDRAW__') = 'UNDEFINED' THEN
  21.     include 'Quickdraw.a'
  22.     ENDIF
  23.  
  24.  
  25. pmCourteous                        EQU        0                    ;Record use of color on each device touched.
  26. pmDithered                        EQU        $0001
  27. pmTolerant                        EQU        $0002                ;render ciRGB if ciTolerance is exceeded by best match.
  28. pmAnimated                        EQU        $0004                ;reserve an index on each device touched and render ciRGB.
  29. pmExplicit                        EQU        $0008                ;no reserve, no render, no record; stuff index into port.
  30. pmWhite                            EQU        $0010
  31. pmBlack                            EQU        $0020
  32. pmInhibitG2                        EQU        $0100
  33. pmInhibitC2                        EQU        $0200
  34. pmInhibitG4                        EQU        $0400
  35. pmInhibitC4                        EQU        $0800
  36. pmInhibitG8                        EQU        $1000
  37. pmInhibitC8                        EQU        $2000                ; NSetPalette Update Constants 
  38. pmNoUpdates                        EQU        $8000                ;no updates
  39. pmBkUpdates                        EQU        $A000                ;background updates only
  40. pmFgUpdates                        EQU        $C000                ;foreground updates only
  41. pmAllUpdates                    EQU        $E000                ;all updates
  42. ColorInfo                RECORD 0
  43. ciRGB                     ds        RGBColor        ; offset: $0 (0)        ; true RGB values
  44. ciUsage                     ds.w    1                ; offset: $6 (6)        ; color usage
  45. ciTolerance                 ds.w    1                ; offset: $8 (8)        ; tolerance value
  46. ciDataFields             ds.w    3                ; offset: $A (10)        ; private fields
  47. sizeof                     EQU *                    ; size:   $10 (16)
  48.                         ENDR
  49. ; typedef struct ColorInfo *            ColorInfoPtr
  50.  
  51. ; typedef ColorInfoPtr *                ColorInfoHandle
  52.  
  53. Palette                    RECORD 0
  54. pmEntries                 ds.w    1                ; offset: $0 (0)        ; entries in pmTable
  55. pmDataFields             ds.w    7                ; offset: $2 (2)        ; private fields
  56. pmInfo                     ds        ColorInfo        ; offset: $10 (16) <-- really an array of length one
  57. sizeof                     EQU *                    ; size:   $20 (32)
  58.                         ENDR
  59. ; typedef struct Palette *                PalettePtr
  60.  
  61. ; typedef PalettePtr *                    PaletteHandle
  62.  
  63. ;
  64. ; pascal void InitPalettes(void )
  65. ;
  66.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  67.         _InitPalettes:    OPWORD    $AA90
  68.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  69.         IMPORT_CFM_FUNCTION InitPalettes
  70.     ENDIF
  71.  
  72. ;
  73. ; pascal PaletteHandle NewPalette(short entries, CTabHandle srcColors, short srcUsage, short srcTolerance)
  74. ;
  75.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  76.         _NewPalette:    OPWORD    $AA91
  77.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  78.         IMPORT_CFM_FUNCTION NewPalette
  79.     ENDIF
  80.  
  81. ;
  82. ; pascal PaletteHandle GetNewPalette(short PaletteID)
  83. ;
  84.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  85.         _GetNewPalette:    OPWORD    $AA92
  86.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  87.         IMPORT_CFM_FUNCTION GetNewPalette
  88.     ENDIF
  89.  
  90. ;
  91. ; pascal void DisposePalette(PaletteHandle srcPalette)
  92. ;
  93.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  94.         _DisposePalette:    OPWORD    $AA93
  95.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  96.         IMPORT_CFM_FUNCTION DisposePalette
  97.     ENDIF
  98.  
  99. ;
  100. ; pascal void ActivatePalette(WindowPtr srcWindow)
  101. ;
  102.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  103.         _ActivatePalette:    OPWORD    $AA94
  104.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  105.         IMPORT_CFM_FUNCTION ActivatePalette
  106.     ENDIF
  107.  
  108. ;
  109. ; pascal void SetPalette(WindowPtr dstWindow, PaletteHandle srcPalette, Boolean cUpdates)
  110. ;
  111.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  112.         _SetPalette:    OPWORD    $AA95
  113.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  114.         IMPORT_CFM_FUNCTION SetPalette
  115.     ENDIF
  116.  
  117. ;
  118. ; pascal void NSetPalette(WindowPtr dstWindow, PaletteHandle srcPalette, short nCUpdates)
  119. ;
  120.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  121.         _NSetPalette:    OPWORD    $AA95
  122.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  123.         IMPORT_CFM_FUNCTION NSetPalette
  124.     ENDIF
  125.  
  126. ;
  127. ; pascal PaletteHandle GetPalette(WindowPtr srcWindow)
  128. ;
  129.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  130.         _GetPalette:    OPWORD    $AA96
  131.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  132.         IMPORT_CFM_FUNCTION GetPalette
  133.     ENDIF
  134.  
  135. ;
  136. ; pascal void CopyPalette(PaletteHandle srcPalette, PaletteHandle dstPalette, short srcEntry, short dstEntry, short dstLength)
  137. ;
  138.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  139.         _CopyPalette:    OPWORD    $AAA1
  140.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  141.         IMPORT_CFM_FUNCTION CopyPalette
  142.     ENDIF
  143.  
  144. ;
  145. ; pascal void PmForeColor(short dstEntry)
  146. ;
  147.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  148.         _PmForeColor:    OPWORD    $AA97
  149.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  150.         IMPORT_CFM_FUNCTION PmForeColor
  151.     ENDIF
  152.  
  153. ;
  154. ; pascal void PmBackColor(short dstEntry)
  155. ;
  156.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  157.         _PmBackColor:    OPWORD    $AA98
  158.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  159.         IMPORT_CFM_FUNCTION PmBackColor
  160.     ENDIF
  161.  
  162. ;
  163. ; pascal void AnimateEntry(WindowPtr dstWindow, short dstEntry, const RGBColor *srcRGB)
  164. ;
  165.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  166.         _AnimateEntry:    OPWORD    $AA99
  167.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  168.         IMPORT_CFM_FUNCTION AnimateEntry
  169.     ENDIF
  170.  
  171. ;
  172. ; pascal void AnimatePalette(WindowPtr dstWindow, CTabHandle srcCTab, short srcIndex, short dstEntry, short dstLength)
  173. ;
  174.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  175.         _AnimatePalette:    OPWORD    $AA9A
  176.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  177.         IMPORT_CFM_FUNCTION AnimatePalette
  178.     ENDIF
  179.  
  180. ;
  181. ; pascal void GetEntryColor(PaletteHandle srcPalette, short srcEntry, RGBColor *dstRGB)
  182. ;
  183.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  184.         _GetEntryColor:    OPWORD    $AA9B
  185.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  186.         IMPORT_CFM_FUNCTION GetEntryColor
  187.     ENDIF
  188.  
  189. ;
  190. ; pascal void SetEntryColor(PaletteHandle dstPalette, short dstEntry, const RGBColor *srcRGB)
  191. ;
  192.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  193.         _SetEntryColor:    OPWORD    $AA9C
  194.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  195.         IMPORT_CFM_FUNCTION SetEntryColor
  196.     ENDIF
  197.  
  198. ;
  199. ; pascal void GetEntryUsage(PaletteHandle srcPalette, short srcEntry, short *dstUsage, short *dstTolerance)
  200. ;
  201.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  202.         _GetEntryUsage:    OPWORD    $AA9D
  203.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  204.         IMPORT_CFM_FUNCTION GetEntryUsage
  205.     ENDIF
  206.  
  207. ;
  208. ; pascal void SetEntryUsage(PaletteHandle dstPalette, short dstEntry, short srcUsage, short srcTolerance)
  209. ;
  210.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  211.         _SetEntryUsage:    OPWORD    $AA9E
  212.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  213.         IMPORT_CFM_FUNCTION SetEntryUsage
  214.     ENDIF
  215.  
  216. ;
  217. ; pascal void CTab2Palette(CTabHandle srcCTab, PaletteHandle dstPalette, short srcUsage, short srcTolerance)
  218. ;
  219.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  220.         _CTab2Palette:    OPWORD    $AA9F
  221.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  222.         IMPORT_CFM_FUNCTION CTab2Palette
  223.     ENDIF
  224.  
  225. ;
  226. ; pascal void Palette2CTab(PaletteHandle srcPalette, CTabHandle dstCTab)
  227. ;
  228.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  229.         _Palette2CTab:    OPWORD    $AAA0
  230.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  231.         IMPORT_CFM_FUNCTION Palette2CTab
  232.     ENDIF
  233.  
  234. ;
  235. ; pascal long Entry2Index(short entry)
  236. ;
  237.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  238.         Macro
  239.         _Entry2Index
  240.             moveq               #0,D0
  241.             dc.w                $AAA2
  242.         EndM
  243.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  244.         IMPORT_CFM_FUNCTION Entry2Index
  245.     ENDIF
  246.  
  247. ;
  248. ; pascal void RestoreDeviceClut(GDHandle gd)
  249. ;
  250.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  251.         Macro
  252.         _RestoreDeviceClut
  253.             moveq               #2,D0
  254.             dc.w                $AAA2
  255.         EndM
  256.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  257.         IMPORT_CFM_FUNCTION RestoreDeviceClut
  258.     ENDIF
  259.  
  260. ;
  261. ; pascal void ResizePalette(PaletteHandle p, short size)
  262. ;
  263.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  264.         Macro
  265.         _ResizePalette
  266.             moveq               #3,D0
  267.             dc.w                $AAA2
  268.         EndM
  269.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  270.         IMPORT_CFM_FUNCTION ResizePalette
  271.     ENDIF
  272.  
  273. ;
  274. ; pascal void SaveFore(ColorSpec *c)
  275. ;
  276.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  277.         Macro
  278.         _SaveFore
  279.             move.w              #$040D,D0
  280.             dc.w                $AAA2
  281.         EndM
  282.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  283.         IMPORT_CFM_FUNCTION SaveFore
  284.     ENDIF
  285.  
  286. ;
  287. ; pascal void SaveBack(ColorSpec *c)
  288. ;
  289.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  290.         Macro
  291.         _SaveBack
  292.             move.w              #$040E,D0
  293.             dc.w                $AAA2
  294.         EndM
  295.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  296.         IMPORT_CFM_FUNCTION SaveBack
  297.     ENDIF
  298.  
  299. ;
  300. ; pascal void RestoreFore(const ColorSpec *c)
  301. ;
  302.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  303.         Macro
  304.         _RestoreFore
  305.             move.w              #$040F,D0
  306.             dc.w                $AAA2
  307.         EndM
  308.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  309.         IMPORT_CFM_FUNCTION RestoreFore
  310.     ENDIF
  311.  
  312. ;
  313. ; pascal void RestoreBack(const ColorSpec *c)
  314. ;
  315.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  316.         Macro
  317.         _RestoreBack
  318.             move.w              #$0410,D0
  319.             dc.w                $AAA2
  320.         EndM
  321.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  322.         IMPORT_CFM_FUNCTION RestoreBack
  323.     ENDIF
  324.  
  325. ;
  326. ; pascal OSErr SetDepth(GDHandle gd, short depth, short whichFlags, short flags)
  327. ;
  328.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  329.         Macro
  330.         _SetDepth
  331.             move.w              #$0A13,D0
  332.             dc.w                $AAA2
  333.         EndM
  334.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  335.         IMPORT_CFM_FUNCTION SetDepth
  336.     ENDIF
  337.  
  338. ;
  339. ; pascal short HasDepth(GDHandle gd, short depth, short whichFlags, short flags)
  340. ;
  341.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  342.         Macro
  343.         _HasDepth
  344.             move.w              #$0A14,D0
  345.             dc.w                $AAA2
  346.         EndM
  347.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  348.         IMPORT_CFM_FUNCTION HasDepth
  349.     ENDIF
  350.  
  351. ;
  352. ; pascal short PMgrVersion(void )
  353. ;
  354.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  355.         Macro
  356.         _PMgrVersion
  357.             moveq               #21,D0
  358.             dc.w                $AAA2
  359.         EndM
  360.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  361.         IMPORT_CFM_FUNCTION PMgrVersion
  362.     ENDIF
  363.  
  364. ;
  365. ; pascal void SetPaletteUpdates(PaletteHandle p, short updates)
  366. ;
  367.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  368.         Macro
  369.         _SetPaletteUpdates
  370.             move.w              #$0616,D0
  371.             dc.w                $AAA2
  372.         EndM
  373.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  374.         IMPORT_CFM_FUNCTION SetPaletteUpdates
  375.     ENDIF
  376.  
  377. ;
  378. ; pascal short GetPaletteUpdates(PaletteHandle p)
  379. ;
  380.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  381.         Macro
  382.         _GetPaletteUpdates
  383.             move.w              #$0417,D0
  384.             dc.w                $AAA2
  385.         EndM
  386.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  387.         IMPORT_CFM_FUNCTION GetPaletteUpdates
  388.     ENDIF
  389.  
  390. ;
  391. ; pascal Boolean GetGray(GDHandle device, const RGBColor *backGround, RGBColor *foreGround)
  392. ;
  393.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  394.         Macro
  395.         _GetGray
  396.             move.w              #$0C19,D0
  397.             dc.w                $AAA2
  398.         EndM
  399.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  400.         IMPORT_CFM_FUNCTION GetGray
  401.     ENDIF
  402.  
  403.  
  404.  
  405.     ENDIF ; __PALETTES__ 
  406.  
  407.